<template>
  <div>
    <img :src="url" alt="" />
    <p @click="likeFn">{{ title }}</p>
  </div>
</template>

<script>
export default {
  props: ['url', 'title', 'index'],
  methods: {
    likeFn() {
      this.$emit('LikeDog', this.index)
    },
  },
}
</script>

<style scoped>
div {
  width: 200px;
  border: 1px solid black;
  text-align: center;
  float: left;
}
img {
  width: 100%;
  height: 200px;
}
p {
  text-align: center;
}
</style>
